package Integrity;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;


public class Result {
	
	Result (String UserID,int ResultID,String BillingSiteID, Xml_Extracted_Data extract){
		userID = UserID;
        billingSiteID = BillingSiteID;
		resultID = ResultID;
		error_code = extract.get_scraped_error_code();
		base_url = extract.get_scraped_base_url();
		type = extract.get_scraped_type();
		date_time = extract.get_scraped_date_with_time();
	}
	public String get_userID() {
		return userID;
	}
	public String get_billingSiteID() {
		return billingSiteID;
	}
	public int get_resultID() {
		return resultID;
	}
	public String get_error_code() {
		return error_code;
	}
	public String get_base_url(){
		return base_url;
	}
	public String get_type() {
		return type;
	}
	public Date get_date() {
		return date_time;
	}
	@Override public String toString() {
		StringBuilder resultToString = new StringBuilder();
		String NEW_LINE = System.getProperty("line.separator");
		resultToString.append("Result Object: " + NEW_LINE);
		resultToString.append("UserID: " + userID + NEW_LINE);
		resultToString.append("resultID: " + resultID + NEW_LINE);
		resultToString.append("billingSiteID: " + billingSiteID + NEW_LINE);
		resultToString.append("base url: " + base_url + NEW_LINE);
		resultToString.append("type: " + type + NEW_LINE);
		resultToString.append("Date and Time: " + df.format(date_time) + NEW_LINE);
		resultToString.append("error code: " + error_code + NEW_LINE);
		return resultToString.toString();
	}
	
	private String userID = "";
    private String billingSiteID = "";
	private int resultID ;
	private String error_code ="";	
	private String base_url="";
	private String type="";
	private Date date_time;
	DateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
}
